serial: Fix IRQ enable/disable in tx interrupt handler.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 27 Oct 2008 11:27:31 +0000 (11:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 27 Oct 2008 11:27:31 +0000 (11:27 +0000)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/drivers/char/serial.c

index 9628b2c96be1ca7fade19605c3a55fc4558d2201..28cd434a5637f28b9ece554406a21f72fec9a486 100644 (file)
@@ -74,7 +74,7 @@ void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
     while ( !spin_trylock(&port->tx_lock) )
     {
         if ( !port->driver->tx_empty(port) )
-            return;
+            goto out;
         cpu_relax();
     }
 
@@ -89,7 +89,10 @@ void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
         }
     }
 
-    spin_unlock_irqrestore(&port->tx_lock, flags);
+    spin_unlock(&port->tx_lock);
+
+ out:
+    local_irq_restore(flags);
 }
 
 static void __serial_putc(struct serial_port *port, char c)